#ifndef __USART_H__
#define __USART_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "main.h"
#include "stdio.h"
#include "string.h"

#define UART1_Rx_GPIO_CLK_ENABLE   __HAL_RCC_GPIOA_CLK_ENABLE
#define UART1_Rx_GPIO_PORT         GPIOA
#define UART1_Rx_GPIO_PIN          GPIO_PIN_7

#define UART1_Tx_GPIO_CLK_ENABLE   __HAL_RCC_GPIOA_CLK_ENABLE
#define UART1_Tx_GPIO_PORT         GPIOA
#define UART1_Tx_GPIO_PIN          GPIO_PIN_6

#define     UART_RX_MAX_LEN            200
typedef struct s_uart_buffer {
    uint16_t index;
    uint8_t data[UART_RX_MAX_LEN];
}uart_buffer;

extern UART_HandleTypeDef huart1;
extern uart_buffer uart_rx_buf;

void PY_USART1_UART_Init(void);

#ifdef __cplusplus
}
#endif

#endif /* __USART_H__ */